package test5;

import java.util.*;
class employee {
    String name;
    String phoneNumber;
    String address;
    employee(String name, String phoneNumber, String address) {
        this.name = name;
        this.phoneNumber = phoneNumber;
        this.address = address;
    }
}
public class javaMain {
    public static void main(String[] args) {
        Map<Integer, employee> employeeMap = new HashMap<Integer, employee>();
        for (Integer employIndex = 1001; employIndex <= 1003; employIndex++) {
            String tmp = employIndex.toString();
            employeeMap.put(employIndex,new employee("employee-" + tmp,
                    "85523927-" + tmp, "address-" + tmp)); // 将员工编号和员工信息插入到employeeMap对象中
        }
        int employeeNo = 0;
        System.out.print("请输入员工编号:");
        Scanner s = new Scanner(System.in);
        employeeNo = s.nextInt(); // 从标准输入获得员工编号
        employee result = employeeMap.get(employeeNo);
        if (result == null) {
            System.out.println("该员工编号不存在 ！");
            return;
        }
        System.out.println("你所查询的员工编号为：" + employeeNo);
        System.out.println("该员工姓名：" + result.name);
        System.out.println("该员工电话：" + result.phoneNumber);
        System.out.println("该员工地址：" + result.address);
    }
}




